/*
 * DTOScenarioElement.cpp
 *
 *  Created on: Oct 23, 2011
 *      Author: gonzalo
 */

#include "DTOScenarioElement.h"
#include "Constantes.h"


DTOScenarioElement::DTOScenarioElement(std::string& aDeserealizar,std::string owner) : DTO(ELEMENT,owner){
	deserializar(aDeserealizar);
}

std::string DTOScenarioElement::serializar(){
	std::stringstream retorno;

	retorno << UtilString::TOlenghtStringStringValue(xPos);
	retorno << UtilString::TOlenghtStringStringValue(yPos);
	retorno << UtilString::TOlenghtStringStringValue(elementImagePath);

	return retorno.str();
}
void DTOScenarioElement::deserializar(std::string& string){
	std::string xpos =UtilString::FROMlenghtStringStringValue(string);
	std::string ypos =UtilString::FROMlenghtStringStringValue(string);

	xPos = atoi(xpos.c_str());
	yPos= atoi(ypos.c_str());
	elementImagePath= UtilString::FROMlenghtStringStringValue(string);
}

DTOScenarioElement::DTOScenarioElement(int xPos, int yPos,std::string elementImagePath) :DTO(ELEMENT,SERVER_OWN) {
	this->xPos =xPos;
	this->yPos = yPos;
	this->elementImagePath = elementImagePath;
}

DTOScenarioElement::~DTOScenarioElement() {}


int DTOScenarioElement::getXPos(){
	return xPos;
}
int DTOScenarioElement::getYPos(){
	return yPos;
}
std::string DTOScenarioElement::getElementImagePath(){
	return elementImagePath;
}

